APPNAME = client
OBJDIR = `pwd`/../
APPPATH = ${OBJDIR}bin/${APPNAME}
CC = gcc
CFLAGS += -I ${OBJDIR}inc/
LIBPATH = ${OBJDIR}lib/
LDFLAGS += -L ${LIBPATH} -lsqlite3 -lmosquitto  -ldl -lpthread


server:create_file
	${CC} `pwd`/*.c -o ${APPPATH}   ${CFLAGS} ${LDFLAGS} 
	
create_file:
	$(shell if [ ! -d $(OBJDIR)bin ]; then mkdir -p $(OBJDIR)bin; fi)
	$(shell if [ ! -d $(OBJDIR)database ]; then mkdir -p $(OBJDIR)database; fi)
	$(shell if [ ! -d $(OBJDIR)logger ]; then mkdir -p $(OBJDIR)logger; fi)


.PHONY:distclean
distclean:
	rm -rf ${OBJDIR}bin
	rm -rf ${OBJDIR}logger
	rm -rf ${OBJDIR}database

